package com.lut.prototype.demo1;

import java.util.Date;

/**
 * @author liuning
 * @ProjectName GOF23
 * @time 2021/12/21 16:11
 */
/*
客户端：克隆
 */
public class Bilibili {
    public static void main(String[] args) throws CloneNotSupportedException {
        //原型对象v1
        Date date = new Date();
        Video v1 = new Video("兰州理工大学", date);
        Video v2 = (Video) v1.clone();
        System.out.println("v1=>"+v1);
        System.out.println("v1.hashcode=>"+v1.hashCode());

        System.out.println("v2=>"+v2);
        System.out.println("v2.hashcode=>"+v2.hashCode());
        System.out.println("================");
        date.setTime(1112233);
        System.out.println("v1=>"+v1);
        System.out.println("v2=>"+v2);

    }
}
/*
//v1 克隆 v2
        //Video v2 = (Video) v1.clone();
        System.out.println("v2=>"+v2);
        System.out.println("v2.hashcode=>"+v2.hashCode());

        v2.setName("clone:兰州理工大学");
        System.out.println(v2);
 */